/**
 * Created by wubo on 2018/3/14.
 */
define(function(require, exports, module) {
    require("vue");
    var store = require("./event/event.index.js");

    module.exports = new Vue({
        store:store,
        data:function(){
            return {
                param:{
                	page:1,
                	limit:10
                },
                data:{
                    list:[],
                    pageSize:10,
                    pageNum:1,
                    total:1000,
                    totalPage:10
                }
                
            }
        },
        methods:{
        },
        watch:{
            "$store.getters.param":function(param){
                this.param = $.extend({},this.param,param);
            },

            "param":function(param){
            	var self = this;
            	$.ajax({
            		url:param.url,
            		data:param,
            		dataType:"JSON",
            		type:"POST",
            	}).done(function(r){
        			self.data = r.data;
            	});
            },

            "data":function(data){
                //
                this.$store.dispatch("refreshGrid",data);

                //this.$store.dispatch("refreshPagination",data);
            },
        }
    });
});